package com.web.dao;

import com.github.pagehelper.Page;
import com.web.controller.web.WebStoreController;
import com.web.dto.StoreApplyDto;
import com.web.dto.StoreDto;
import com.web.entity.Store;
import com.web.utils.mybatis.SimpleSelectInLangDriver;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

/**
 * @author FDjavaone
 */
public interface StoreMapper {


    @Delete({
            "delete from t_store ",
            " where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
            "insert into t_store (m_id, type, ",
            " merchant_name, level, ",
            " logo, licence_no, ",
            " licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, ",
            " province, city, ",
            " region, street, ",
            " address, lng,lat,business_status,merchant_img, create_time, ",
            " modify_time) ",
            " values (#{mId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, ",
            " #{merchantName,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, ",
            " #{logo,jdbcType=VARCHAR}, #{licenceNo,jdbcType=VARCHAR}, ",
            " #{licenceImg,jdbcType=VARCHAR},#{identityAImg,jdbcType=VARCHAR},#{identityBImg,jdbcType=VARCHAR},#{storeImg,jdbcType=VARCHAR}, #{contactor,jdbcType=VARCHAR}, ",
            " #{contactPhone,jdbcType=VARCHAR}, #{contactTel,jdbcType=VARCHAR}, ",
            " #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, ",
            " #{region,jdbcType=VARCHAR}, #{street,jdbcType=VARCHAR}, ",
            " #{address,jdbcType=VARCHAR}, #{lng,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE},#{business_status,jdbcType=INTEGER}, #{merchant_img,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
            " #{modifyTime,jdbcType=TIMESTAMP}),",
            " #{storeType,jdbcType=VARCHAR}),",
    })
    @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Long.class)
    int insert(Store record);

    @InsertProvider(type = StoreSqlProvider.class, method = "insertSelective")
    @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Long.class)
    int insertSelective(Store record);


    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)

    })
    Store selectByPrimaryKey(Long id);


    @UpdateProvider(type = StoreSqlProvider.class, method = "updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Store record);

    @Update({
            "update t_store ",
            " set m_id = #{mId,jdbcType=BIGINT},",
            " type = #{type,jdbcType=VARCHAR},",
            " merchant_name = #{merchantName,jdbcType=VARCHAR},",
            " level = #{level,jdbcType=VARCHAR},",
            " logo = #{logo,jdbcType=VARCHAR},",
            " licence_no = #{licenceNo,jdbcType=VARCHAR},",
            " licence_img = #{licenceImg,jdbcType=VARCHAR},",
            " identity_a_img = #{identityAImg,jdbcType=VARCHAR},",
            " identity_b_img = #{identityBImg,jdbcType=VARCHAR},",
            " store_img = #{storeImg,jdbcType=VARCHAR},",
            " contactor = #{contactor,jdbcType=VARCHAR},",
            " contact_phone = #{contactPhone,jdbcType=VARCHAR},",
            " contact_tel = #{contactTel,jdbcType=VARCHAR},",
            " province = #{province,jdbcType=VARCHAR},",
            " city = #{city,jdbcType=VARCHAR},",
            " region = #{region,jdbcType=VARCHAR},",
            " street = #{street,jdbcType=VARCHAR},",
            " address = #{address,jdbcType=VARCHAR},",
            " lng = #{lng,jdbcType=DOUBLE},",
            " lat = #{lat,jdbcType=DOUBLE},",
            " merchant_img = #{merchantImg,jdbcType=VARCHAR},",
            " business_status = #{businessStatus,jdbcType=INTEGER},",
            " create_time = #{createTime,jdbcType=TIMESTAMP},",
            " modify_time = #{modifyTime,jdbcType=TIMESTAMP},",
            " storeType = #{storeType,jdbcType=VARCHAR} ",
            " where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Store record);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,business_status,merchant_img, create_time, ",
            " modify_time,storeType",
            " from t_store ",
            " where m_id = #{id,jdbcType=BIGINT}"
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    Store selectByMid(Long id);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{id,jdbcType=BIGINT}  order by distance asc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    List<StoreDto> selectStoreAround(Store store);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{store.lat,jdbcType=DOUBLE},#{store.lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{store.id,jdbcType=BIGINT}  and merchant_name like #{store.merchantName,jdbcType=VARCHAR} or  id in(#{ids}) order by distance asc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    @Lang(SimpleSelectInLangDriver.class)
    List<StoreDto> selectStoreAroundAndByAddress(@Param("store") Store store, @Param("ids") List<Long> ids);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{store.lat,jdbcType=DOUBLE},#{store.lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{store.id,jdbcType=BIGINT}  and province=#{store.province,jdbcType=VARCHAR} and city=#{store.city,jdbcType=VARCHAR} and region=#{store.region,jdbcType=VARCHAR} and merchant_name like #{store.merchantName,jdbcType=VARCHAR}  or  id in(#{ids}) order by level desc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    @Lang(SimpleSelectInLangDriver.class)
    List<StoreDto> selectStoreAroundAndByLevel(@Param("store") Store store, @Param("ids") List<Long> ids);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{store.lat,jdbcType=DOUBLE},#{store.lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{store.id,jdbcType=BIGINT}  and type=#{store.type,jdbcType=VARCHAR} and merchant_name like #{store.merchantName,jdbcType=VARCHAR} or  id in(#{ids}) order by distance asc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    @Lang(SimpleSelectInLangDriver.class)
    List<StoreDto> selectStoreAroundAndByAddressAndType(@Param("store") Store store, @Param("ids") List<Long> ids);


    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{store.lat,jdbcType=DOUBLE},#{store.lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{store.id,jdbcType=BIGINT}  and type=#{store.type,jdbcType=VARCHAR} and province=#{store.province,jdbcType=VARCHAR} and city=#{store.city,jdbcType=VARCHAR} and region=#{store.region,jdbcType=VARCHAR} and merchant_name like #{store.merchantName,jdbcType=VARCHAR} or  id in(#{ids}) order by level desc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    @Lang(SimpleSelectInLangDriver.class)
    List<StoreDto> selectStoreAroundAndByLevelAndType(@Param("store") Store store, @Param("ids") List<Long> ids);


    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{id,jdbcType=BIGINT}  and type=#{type,jdbcType=VARCHAR}  order by distance asc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    List<StoreDto> selectStoreByTypeAndNoKeywordOrderByDistance(Store store);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1' and m_id!=#{id,jdbcType=BIGINT}  and type=#{type,jdbcType=VARCHAR} and province=#{province,jdbcType=VARCHAR} and city=#{city,jdbcType=VARCHAR} and region=#{region,jdbcType=VARCHAR}  order by level desc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    List<StoreDto> selectStoreByTypeAndNoKeywordOrderByLevel(Store store);

    @Select({
            "select",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1'  and m_id!=#{id,jdbcType=BIGINT}   order by distance asc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    List<StoreDto> selectStoreAroundAndByAddressNoKeyword(Store store);

    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,countDistance(#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE},lat,lng) as distance,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where business_status='1'  and m_id!=#{id,jdbcType=BIGINT}  and province=#{province,jdbcType=VARCHAR} and city=#{city,jdbcType=VARCHAR} and region=#{region,jdbcType=VARCHAR}  order by level desc "
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "distance", property = "distance", jdbcType = JdbcType.VARCHAR),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    List<StoreDto> selectStoreAroundAndByLevelNoKeyword(Store store);


    @SelectProvider(type = StoreSqlProvider.class, method = "selectAllStore")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    Page<Store> selectAllStore(WebStoreController.StoreColumns storeColumns);

    @Select({
            "select count(0) from t_store where type='企业'"
    })
    Integer countOnline();

    @Select({
            "select count(0) from t_store "
    })
    Integer countTotal();


    @SelectProvider(type = StoreSqlProvider.class, method = "selectAllStoreByName")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)
    })
    Page<Store> selectAllStoreByName(WebStoreController.StoreColumns storeColumns);


    @Select({
            "select ",
            " id, m_id, type, merchant_name, level, logo, licence_no, licence_img,identity_a_img,identity_b_img,store_img, contactor, ",
            " contact_phone, contact_tel, province, city, region, street, address, lng,lat,business_status,merchant_img, create_time, ",
            " modify_time,storeType ",
            " from t_store ",
            " where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "level", property = "level", jdbcType = JdbcType.VARCHAR),
            @Result(column = "logo", property = "logo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "lng", property = "lng", jdbcType = JdbcType.DOUBLE),
            @Result(column = "lat", property = "lat", jdbcType = JdbcType.DOUBLE),
            @Result(column = "business_status", property = "businessStatus", jdbcType = JdbcType.INTEGER),
            @Result(column = "merchant_img", property = "merchantImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR)

    })
    Page<Store> selectById(Long id);

    @Select("select id from t_store where id in(#{ids}) and  business_status='1' ")
    @Lang(SimpleSelectInLangDriver.class)
    List<Long> fitterOnBusinessStore(@Param("ids") List<Long> ids);


    @SelectProvider(type = StoreSqlProvider.class, method = "selectAllKftAbout")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR),
            @Result(column = "id_card_hold", property = "idCardHold", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_open", property = "bankOpen", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_card_front", property = "bankCardFront", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_card_back", property = "bankCardBack", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_front", property = "storeFront", jdbcType = JdbcType.VARCHAR),
            @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT),
            @Result(column = "reason", property = "reason", jdbcType = JdbcType.VARCHAR),
            @Result(column = "id_valid_date", property = "idValidDate", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_valid_date", property = "licenceValidDate", jdbcType = JdbcType.VARCHAR)

    })
    Page<StoreApplyDto> selectAllKftAbout(WebStoreController.StoreColumns storeColumns);


    @SelectProvider(type = StoreSqlProvider.class, method = "selectAllKftNeed")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
            @Result(column = "m_id", property = "mId", jdbcType = JdbcType.BIGINT),
            @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR),
            @Result(column = "merchant_name", property = "merchantName", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_no", property = "licenceNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_img", property = "licenceImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_a_img", property = "identityAImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "identity_b_img", property = "identityBImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_img", property = "storeImg", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contactor", property = "contactor", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_phone", property = "contactPhone", jdbcType = JdbcType.VARCHAR),
            @Result(column = "contact_tel", property = "contactTel", jdbcType = JdbcType.VARCHAR),
            @Result(column = "province", property = "province", jdbcType = JdbcType.VARCHAR),
            @Result(column = "city", property = "city", jdbcType = JdbcType.VARCHAR),
            @Result(column = "region", property = "region", jdbcType = JdbcType.VARCHAR),
            @Result(column = "street", property = "street", jdbcType = JdbcType.VARCHAR),
            @Result(column = "address", property = "address", jdbcType = JdbcType.VARCHAR),
            @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "modify_time", property = "modifyTime", jdbcType = JdbcType.TIMESTAMP),
            @Result(column = "storeType", property = "storeType", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_open", property = "bankOpen", jdbcType = JdbcType.VARCHAR),
            @Result(column = "id_card_hold", property = "idCardHold", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_card_front", property = "bankCardFront", jdbcType = JdbcType.VARCHAR),
            @Result(column = "bank_card_back", property = "bankCardBack", jdbcType = JdbcType.VARCHAR),
            @Result(column = "store_front", property = "storeFront", jdbcType = JdbcType.VARCHAR),
            @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT),
            @Result(column = "reason", property = "reason", jdbcType = JdbcType.VARCHAR),
            @Result(column = "id_valid_date", property = "idValidDate", jdbcType = JdbcType.VARCHAR),
            @Result(column = "licence_valid_date", property = "licenceValidDate", jdbcType = JdbcType.VARCHAR)


    })
    List<StoreApplyDto> selectAllKftNeed();
}